package com.yb.xczx.cloud.auth.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.Authentication;
import org.springframework.security.oauth2.server.resource.authentication.BearerTokenAuthentication;
import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Copyright (C), 2022-2023, 姚兵
 * Author: 32210
 * Date: 2023/5/16 10:49
 * FileName: UserDetail
 * Description:
 */

@RestController
@RequestMapping("/user")
@Slf4j
public class UserDetailController{

    @PreAuthorize("hasAuthority('SCOPE_profilehaha')")
    @RequestMapping("/detail")
    public Object detail(BearerTokenAuthentication authentication){
        log.info("authentication detail:{}",authentication);
        return authentication;
    }
}
